JavaScript

{dialog.object}addCustomSchemeForAlphaWkWebView Method

Syntax

var result = {dialog.object}addCustomSchemeForAlphaWkWebView(fileURL)

Arguments

fileURLstring

The file URL to add a custom scheme.

Returns

resultstring

Returns a local URL prefixed with "alpha-local://extension?url=" where "extension" is the file extension. For example, if fileURL is a .jpg file, the prefix will be alpha-local://jpg?url=

Description

Adds a local URL prefix to a file URL so that it can be referenced in the source property for an image, video, audio, or other element in an iOS Cordova app using the WkWebView plugin.

Discussion

When using the Alpha WkWebView plugin, you cannot set the src property of an image, audio, video, etc, element directly. You must add the appropriate scheme to the file URL using this method.

{dialog.object}.addCustomSchemeForAlphaWkWebView() wraps the file URL in the required scheme and returns a URL that can be used with image, audio, video, and other elements in the UX component.

var fileURL2 = {dialog.object}.addCustomSchemeForAlphaWkWebView(fileURL);
var ele = {dialog.object}.getPointer('image_1');
ele.src = fileURL2;

If used in a Cordova application using the UIWebView plugin, or if the application is running on an Android device, the file URL is not modified.

Limitations

Cordova Applications using Alpha WkWebView Only

See Also